package com.czk.grouptask;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * 组任务的流程部署
 * @Author ChenZhangKun
 * @Date 2020/9/15 11:21
 */
public class GroupTaskDeployment {
    public static void main(String[] args) {
        // 获取流程引擎
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        // 获取部署任务
        RepositoryService repositoryService = processEngine.getRepositoryService();
        // 部署bpm
        Deployment deployment = repositoryService.createDeployment()
                .addClasspathResource("diagram/czk.bpmn")
                .addClasspathResource("diagram/czk.png")
                .name("组任务的请假流程")
                .deploy();
        // 输出部署信息
        System.out.println("部署名称 "+deployment.getName());
        System.out.println("部署id "+deployment.getId());
    }
}
